package com.movitech.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 日志管理,统一日志打印，避免业务代码里使用不同日志打印，导致日志打印配置混乱。
 *
 * @author luodz
 * @version 1.0.0
 * @description
 * @createTime 2021/08/16
 * @copyright Copyright ©️ 2021 北京魔马科技
 */
public class LoggerManager {
    public Logger logger;

    public static LoggerManager get(Class<?> clazz) {
        LoggerManager loggerManager = new LoggerManager(clazz);
        return loggerManager;
    }

    private LoggerManager(Class<?> clazz) {
        this.logger = LoggerFactory.getLogger(clazz);
    }

    public void info(String message) {
        logger.info(message);
    }

    public void info(String message, Object object) {
        logger.info(message, object);
    }

    public void debug(String message) {
        logger.debug(message);
    }

    public void debug(String message, Object object) {
        logger.debug(message, object);
    }

    public void trace(String message) {
        logger.trace(message);
    }

    public void trace(String message, Object object) {
        logger.trace(message, object);
    }

    public void warn(String message) {
        logger.warn(message);
    }

    public void warn(String message, Object object) {
        logger.warn(message, object);
    }

    public void error(String message) {
        logger.error(message);
    }

    public void error(String message, Object object) {
        logger.error(message, object);
    }

    public void error(String message, Throwable throwable) {
        logger.error(message, throwable);
    }
}
